<template>
	<view class="content">
		<image class="logo" src="/static/logo.png" />
		<uni-badge text="1"></uni-badge>
		<uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>

		<view class="text-area">
			<text class="title" @click="fetch">{{ title }}</text>
			{{ data }}
			{{ loading }}
			....
		</view>
	</view>
</template>

<script lang="ts" setup>
import {
  ref,
} from 'vue';
import {
  fetchUserById,
} from '../../api/fileHelp';
import {
  useRequest,
} from '../../hooks';
import {
  userDtoType,
} from '../../api/fileHelp/dto-type';
import {
  userFetchType,
} from '../../api/fileHelp/fetch-type';

const {  
  data,
  loading,
  fetch,
} = useRequest  (fetchUserById, {
  params: {
    userId: 'mock-user-id',
  },
});
console.log(data.value?.age);

const title = ref('Hello');
// const fetch = async () => {
//   const res = await fetchUserById({ userId: 'mock ' });
//   console.log(res);
// };
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: red
	}

	.logo {
		height: 200 rpx;
		width: 200 rpx;
		margin-top: 200 rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50 rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36 rpx;
		color: #8f8f94;
	}
</style>
